home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-04-19 | 5.7 KB | 184 lines | [TEXT/ttxt] |
- Settings File = GEnie
- Script Name = Quotes - Historical
- Command Key = U
- F-Key =
- Menu = YES
- Button = NO
- Version = 3007
- System = Macintosh
-
- 1 Remark "Microphone II Script to download historical quotes from GEnie"
- 2 Remark ""
- 3 Remark "This script requests up to 52 weeks of weekly data for the stocks you request."
- 4 Remark "It is intended for stocks that you are adding to your Market Charter stack."
- 5 Remark "It creates a file for each stock you request to import into the stock's chart."
- 6 Remark ""
- 7 Remark "Requires the script 'Ask Date'"
- 8 Remark ""
- 9 Remark "Written by Melvyn D. Magree, (M)agreeable software, inc."
- 10 Remark "For use with Market Charter™, a HyperCard® stack published by"
- 11 Remark ""
- 12 Remark " Survivor Software Ltd."
- 13 Remark " 11222 La Cienega Blvd., Suite 450"
- 14 Remark " Inglewood CA 90304"
- 15 Remark " (213) 410-9527"
- 16 Remark ""
- 17 Remark "Latest update of this script - 91-04-19"
- 18 Remark ""
- 19 Set Variable * MaxWait from Expression "60"
- 20 Set Variable * StartEnd from Expression "'Start'"
- 21 Do Script * "'Ask Date'"
- 22 If Expression "GivenDate<>''"
- 23 Set Variable * StartDate from Expression "GivenDate"
- 24 Else
- 25 Abort Script
- 26 End If
- 27 Set Variable * StartEnd from Expression "'End'"
- 28 Do Script * "'Ask Date'"
- 29 Set Variable * EndDate from Expression "GivenDate"
- 30 Set Variable * i from Expression "0"
- 31 Set Variable * Symbol from Expression "'x'"
- 32 While Expression "Symbol<>''"
- 33 Set Variable * Symbol from Dialog Box "'Enter Stock Symbol (blank to end)^M'"
- 34 If Expression "Symbol<>''"
- 35 Set Variable * i from Expression "i+1"
- 36 Set Variable * SymbolList[i] from Expression "Symbol"
- 37 End If
- 38 End While
- 39 If Expression "not Exists(SymbolList)"
- 40 Abort Script
- 41 End If
- 42 If Expression "false"
- 43 Set Variable * UserID from Dialog Box "'Enter GEnie Account Number'"
- 44 Else
- 45 Do Script * "'Check Profile'"
- 46 If Expression "UserID=''"
- 47 Abort Script
- 48 End If
- 49 End If
- 50 If Expression "false"
- 51 Set Variable * Password from Dialog Box (prot.) "'Enter your password'"
- 52 Else
- 53 If Expression "Password=''"
- 54 Abort Script
- 55 End If
- 56 End If
- 57 Dial Service * "'GEnie'"
- 58 If Failure
- 59 Abort Script
- 60 End If
- 61 Send Text String "'H'"
- 62 Wait Seconds "1"
- 63 Send Text String "'H'"
- 64 Wait Seconds "1"
- 65 Send Text String "'H'"
- 66 When Text Equals "'U#='"
- 67 Send Text String "UserID&','&Password&'^M'"
- 68 Or When Seconds Have Passed "30"
- 69 Hang Up
- 70 Abort Script
- 71 End When
- 72 When Text Equals "'continue?'"
- 73 Or When Text Equals "'Reenter U#'"
- 74 Hang Up
- 75 Abort Script
- 76 Or When Seconds Have Passed "MaxWait"
- 77 Hang Up
- 78 Abort Script
- 79 End When
- 80 Set Variable * started from Expression "TickCount"
- 81 Set Term Param Local Echo Yes
- 82 Send Text String "'quotes^M'"
- 83 When Text Equals "'<H>elp?'"
- 84 Or When Text Equals "'P 780?'"
- 85 Or When Seconds Have Passed "MaxWait"
- 86 Chain to Script "'Sign Off'"
- 87 End When
- 88 Send Text String "'1^M'"
- 89 Wait for Text "'oice?'"
- 90 Send Text String "'4^M'"
- 91 Wait for Text "'HELP'"
- 92 Wait for Text "'Specifier?'"
- 93 Set Variable * i from Expression "0"
- 94 While Expression "i<ListSize(SymbolList)"
- 95 Set Variable * i from Expression "i+1"
- 96 Dialog Install "'Requesting '&SymbolList[i]"
- 97 Send Text String "'t='&SymbolList[i]&'^M'"
- 98 When Text Equals "'Y/N)?'"
- 99 Send Text String "'y^M'"
- 100 Or When Text Equals "'No matching issues found'"
- 101 Send Local to Screen "'^M'"
- 102 Wait for Text "'Specifier?'"
- 103 Cycle
- 104 Or When Seconds Have Passed "MaxWait"
- 105 Hang Up
- 106 Abort Script
- 107 End When
- 108 When Text Equals "'<D>ividends?'"
- 109 Send Text String "'i^M'"
- 110 Or When Seconds Have Passed "MaxWait"
- 111 Hang Up
- 112 Abort Script
- 113 End When
- 114 Wait for Text "'<W>eekly?'"
- 115 Send Text String "'w^M'"
- 116 When Text Equals "'Date?'"
- 117 Send Text String "StartDate&'^M'"
- 118 End When
- 119 When Text Equals "'Date?'"
- 120 Send Text String "EndDate&'^M'"
- 121 Or When Text Equals "'No weekly history available'"
- 122 Send Local to Screen "'^M'"
- 123 Wait for Text "'Specifier?'"
- 124 Cycle
- 125 End When
- 126 When Text Equals "'Continue?'"
- 127 Send Text String "'2^M'"
- 128 End When
- 129 Wait for Text "'inue?'"
- 130 Send Text String "'5^M'"
- 131 Wait for Text "'inue?'"
- 132 Send Text String "'^M'"
- 133 Wait for Text "'Y/N)?'"
- 134 Send Text String "'y^M'"
- 135 File * Open "SymbolList[i]"
- 136 If Success
- 137 File * Set EOF "SymbolList[i] , 0"
- 138 Else
- 139 Dialog Update "'File for '&SymbolList[i]&' could not be opened.'"
- 140 Wait for Text "'Specifier?'"
- 141 Leave
- 142 End If
- 143 Dialog Install "'Downloading '&SymbolList[i]"
- 144 Set Variable * EndOfData from Expression "False"
- 145 Repeat
- 146 When Text in Stream is "'^M'"
- 147 Set Variable * currentLine from Expression "TheLine(CursorRow)"
- 148 If Expression "length(currentLine)>6"
- 149 File * Write "SymbolList[i] , currentLine&'^M'"
- 150 Else If Expression "length(currentLine)=0"
- 151 Remark "Ignore preceding blank line"
- 152 Else
- 153 Remark "Line with SPACE-RETURN is end of data"
- 154 Set Variable * EndOfData from Expression "True"
- 155 End If
- 156 Or When Seconds Have Passed "2*MaxWait"
- 157 Remark "Response is too slow. Quit!"
- 158 File * Close "SymbolList[i]"
- 159 Hang Up
- 160 Abort Script
- 161 End When
- 162 Until Expression "EndOfData"
- 163 File * Close "SymbolList[i]"
- 164 Wait for Text "'Specifier?'"
- 165 End While
- 166 Dialog Discard
- 167 Send Text String "'quit^M'"
- 168 When Text Equals "'<H>elp?'"
- 169 Or When Text Equals "'P 780?'"
- 170 Or When Seconds Have Passed "MaxWait"
- 171 Hang Up
- 172 Abort Script
- 173 End When
- 174 Chain to Script "'Sign Off'"
-